#ifndef		GUI__Control_h
#define		GUI__Control_h

#include	"IControl.h"
#include	<Math/Vector.h>

class Window;
class Mouse;

class Control : public IControl
{
public:
	Control(Window * window, Mouse * mouse, const Vector2i & windowSize, const Vector2i & position, const Vector2i & size, bool visible);
	virtual ~Control();
	virtual void update(double delay);
	virtual void message(int id, void * parameter);
	virtual void updateAnimation(double delay) = 0;
	virtual void render() const = 0;
public:
	const Vector2i & getWindowSize() const;
	const Vector2i & getPosition() const;
	const Vector2i & getSize() const;
	bool getVisible() const;
	void setWindowSize(const Vector2i & windowSize);
	void setPosition(const Vector2i & position);
	void setSize(const Vector2i & size);
	void setVisible(bool visible);
protected:
	bool IsInside(const Vector2i & position) const;
protected:
	Window * m_window;
	Mouse * m_mouse;
	Vector2i m_windowSize;
	Vector2i m_position;
	Vector2i m_size;
	bool m_visible;
private:
	bool m_mouseInside;
	bool m_mouseLeftDown;
	bool m_mouseRightDown;
};

#endif	//	GUI__Control_h

